$(function() {
				var $form_div = $("#zbYearTotal_form div");
				winResize($form_div);
				$(window).resize(function(){//当调整浏览器窗口的大小时，发生 resize 事件
					winResize($form_div);
				});
				loadTable();
				
})


var $form = $('#zbYearTotal_form');

function  loadTable()
{	
	var columnsAll = new Array();
	columnsAll.push({field:'ids',title:'ids',align:'center',rowspan:2,hidden:true});
//	columnsAll.push({field:'orgname',title:'门店',align:'center',rowspan:2});
	columnsAll.push({field:'date',title:'日期',align:'center',rowspan:2});
	columnsAll.push({field:'zxrs',title:'咨询人数',rowspan:2,align:'center'});
	columnsAll.push({field:'xgkcj',title:'成交人数',colspan:4,align:'center'});
	columnsAll.push({field:'xgk',title:'新顾客',colspan:4,align:'center'});
	columnsAll.push({field:'sddrs',title:'到店人数',rowspan:2,align:'center'});
	columnsAll.push({field:'fwrs',title:'服务人数',rowspan:2,align:'center'});
	columnsAll.push({field:'fwcs',title:'服务次数',rowspan:2,align:'center'});
//	columnsAll.push({field:'dcrs',title:'掉秤人数',rowspan:2,align:'center'});
//	columnsAll.push({field:'dcjs',title:'掉秤斤数',rowspan:2,align:'center'});
//	columnsAll.push({field:'zcrs',title:'涨称人数',rowspan:2,align:'center'});
//	columnsAll.push({field:'zcjs',title:'涨称斤数',rowspan:2,align:'center'});
//	columnsAll.push({field:'pcrs',title:'平称人数',rowspan:2,align:'center'});
//	columnsAll.push({field:'dcrszb',title:'掉秤人数占比',rowspan:2,align:'center',
//		formatter: function(value,row,index)
//		{	
//			if(value!=null){ return  value+"%";}
//		}
//	});
	columnsAll.push({field:'dbrs',title:'达标人数',rowspan:2,align:'center'});
	columnsAll.push({field:'sycprs',title:'使用产品人数',rowspan:2,align:'center'});
	columnsAll.push({field:'sycprszb',title:'使用产品人数占比',rowspan:2,align:'center',
		formatter: function(value,row,index)
		{	
			if(value!=null){ return  value+"%";}
		}
	});
	columnsAll.push({field:'lc001',title:'标准疗程',colspan:2,align:'center'});
	columnsAll.push({field:'lc002',title:'单疗程',colspan:2,align:'center'});
	columnsAll.push({field:'hf001',title:'紧致清润洁面膏',colspan:2,align:'center'});
	columnsAll.push({field:'hf002',title:'换能新生紧肤水',colspan:2,align:'center'});
	columnsAll.push({field:'hf003',title:'焕能紧肤润体乳',colspan:2,align:'center'});
	columnsAll.push({field:'hf004',title:'焕能抗皱紧致乳霜',colspan:2,align:'center'});
	columnsAll.push({field:'hf005',title:'焕能精华液',colspan:2,align:'center'});
	columnsAll.push({field:'hf011',title:'泰和三清',colspan:2,align:'center'});
	columnsAll.push({field:'ss001',title:'本草焕能紧肤精油',colspan:2,align:'center'});
	columnsAll.push({field:'ss002',title:'本草焕能紧肤膏',colspan:2,align:'center'});
	columnsAll.push({field:'jzzxse',title:'减重总销售额',rowspan:2,align:'center'});
	columnsAll.push({field:'pricetotal',title:'销售总额',rowspan:2,align:'center'});
	
	
	var columnsAll1 = new Array();
	columnsAll1.push({field:'zjscjrs',title:'转介绍',align:'center'});
	columnsAll1.push({field:'xccjrs',title:'宣传',align:'center'});
	columnsAll1.push({field:'zrjdcjrs',title:'自然进店',align:'center'});
	columnsAll1.push({field:'cjrs',title:'合计',align:'center'});
	columnsAll1.push({field:'xgkcjl',title:'成交率',align:'center',
		formatter: function(value,row,index)
		{	
			if(value!=null){ return  value+"%";}
		}
	});
	columnsAll1.push({field:'xgkdlcs',title:'单疗程数',align:'center'});
	columnsAll1.push({field:'xgklcs',title:'疗程数',align:'center'});
	columnsAll1.push({field:'xgkyjjs',title:'应减斤数',align:'center'});
	columnsAll1.push({field:'lc001salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'lc001salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'lc002salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'lc002salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf001salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf001salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf002salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf002salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf003salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf003salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf004salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf004salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf005salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf005salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'hf011salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'hf011salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'ss001salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'ss001salprice',title:'金额',width:50,align:'center'});
	columnsAll1.push({field:'ss002salnum',title:'数量',width:50,align:'center'});
	columnsAll1.push({field:'ss002salprice',title:'金额',width:50,align:'center'});
	
	
	
	$('#zbYearTotal_datagrid').datagrid({
		cls: "theme-datagrid",
		singleSelect:true,
		frozenColumns:[[{field:'orgname',title:'门店',width:100,align:'center'},]],
		fitColumns:false,
		rownumbers: true,
	    columns:[columnsAll,columnsAll1],
	    url: "zbYearTotalStatistic/getZbYearTotal",
	    queryParams: sy.serializeObject($form),
	    pagination: true,
	    pageSize: 10,
	 	method: 'post'
	});
}

function searchFrom(){
//	loadTable();
	$('#zbYearTotal_datagrid').datagrid('load',sy.serializeObject($form));
}


